package main

import (
	"fmt"

	"demo/apiservice/internal/config"
	"demo/apiservice/internal/handler"
	"demo/apiservice/internal/svc"

	"github.com/zeromicro/go-zero/rest"
)

func main() {

	var c config.Config
	c.Host = "0.0.0.0"
	c.Port = 8000

	server := rest.MustNewServer(c.RestConf)
	defer server.Stop()

	ctx := svc.NewServiceContext(c)
	handler.RegisterHandlers(server, ctx)

	fmt.Printf("Starting server at %s:%d...\n", c.Host, c.Port)
	server.Start()
}
